package com.qf.service;

import com.qf.dao.UserMapper;
import com.qf.pojo.User;

/**
 * projectName:my_profile
 * author:luo
 * time:2023/1/30 9:57
 */
public class UserServiceImpl implements UserService {
    private UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public UserMapper getUserMapper() {
        return userMapper;
    }

    @Override
    public boolean checkUser(String username) {
        User user= userMapper.selectUser(username);
        if (user==null){
            return false;
        }
        return true;
    }

    @Override
    public void regist(String username, String password) {
        userMapper.insert(username,password);
    }

    @Override
    public User login(String username, String password) {
        return userMapper.select(username,password);
    }
}
